<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title></title>
    <link rel="stylesheet" href="__PUBLIC__/Css/public.css"/>
    <script type="text/javascript" src="__PUBLIC__/Js/jquery-1.7.2.min.js"></script>
    <script type='text/javascript'>
    $(function(){
        var y=$('#y').text();
        var t=$('#t').text();
        var kk=$('select[name=school_year] > option');
        var ll=$('select[name=term] > option');
        for(var i=0;i<kk.length;i++){
            if($(kk[i]).val()==y){
                $(kk[i]).attr("selected",true);
            }
        }

        for(var i=0;i<ll.length;i++){
            if($(ll[i]).val()==t){
                $(ll[i]).attr("selected",true);
            }
        }


    });
</script>
</head>
<body>
<form action="<?php echo U('Index/Index/show');?>" method="post">
    <h3>请选择学年</h3>
    <select name="school_year">
        <?php if(is_array($sch_year)): foreach($sch_year as $key=>$m): ?><option value="<?php echo ($m["l"]); ?>-<?php echo ($m["b"]); ?>"><?php echo ($m["l"]); ?>-<?php echo ($m["b"]); ?></option><?php endforeach; endif; ?>
    </select>
    <h3>请选择学期</h3>
    <select name="term">
        <option value="1">1</option>
        <option value="2">2</option>

    </select>

 <input type="hidden" name="student_number" value="<?php echo ($number); ?>">


    <input type="submit" value="查询">

</form>

<table class="table">
    <tr>

        <th>学籍号</th>
        <th>考号</th>
        <th>班级</th>
        <th>姓名</th>
        <th>学年</th>
        <th>学期</th>
    </tr>
    <tr>
        <td><?php echo ($nati["student_number"]); ?></td>
        <td><?php echo ($nati["test_number"]); ?></td>
        <td><?php echo ($nati["class"]); ?></td>
        <td><?php echo ($nati["student_name"]); ?></td>
        <td id="y"><?php echo ($nati["school_year"]); ?></td>
        <td id="t"><?php echo ($nati["term"]); ?></td>
    </tr>
    <?php if(is_array($sub_res)): foreach($sub_res as $key=>$v): ?><tr>
            <td><?php echo ($v["subject"]); ?></td>
            <td><?php echo ($v["result"]); ?></td>
        </tr><?php endforeach; endif; ?>
    <tr>
        <td>平均分</td>
        <td><?php echo ($p); ?></td>
    </tr>
    <tr>
        <td>总分</td>
        <td><?php echo ($z); ?></td>
    </tr>
    <tr>
        <td>合格科目数</td>
        <td><?php echo ($hh); ?></td>
    </tr>
    <tr>
        <td>班级等级</td>
        <td><?php echo ($d); ?></td>
    </tr>
    <tr>
        <td>全校等级</td>
        <td><?php echo ($dd); ?></td>
    </tr>


</table>
</body>
</html>